/*
* Project : Linuxbox
* File    : AdminLogin.java
* Version : 1.0
* Author  : Kevin Zhang
*
* Copyright (c) 2000-2001 by Linuxbox, Inc.
* All rights reserved.
 */
package linuxbox.system.servlet;

import javax.servlet.http.*;

import linuxbox.BoxStatic;
import linuxbox.common.*;

public class ServiceSwitchAction extends Action {
  protected static String successJSP = null;

  public void doAction(HttpSession aSession, BoxSession aBoxSession,
                       HttpServletRequest req, HttpServletResponse res) throws Exception {
    //aSession.invalidate();
    if (aBoxSession.isSystemAdmin()) {
      BoxStatic.serviceSwitch = !BoxStatic.serviceSwitch;
      redirectFile(successJSP, req, res);
    }
    else{
      redirectFile(BoxStatic.accessRightErrorJSP, req, res);
    }
  }

  public void setSuccessJSP(String str) {
    successJSP = str;
  }
}